<script setup lang="ts">
import { useCountDown } from '@/hooks';

// 组合式API封装后，调用起来比较方便
const { count, resume, pause, start } = useCountDown();
// 直接调用
start(120);
</script>

<template>
  <h1>倒计时业务封装测试-VueUse</h1>
  <!-- 点击按钮调用 -->
  <button @click="start(120)">
    {{ count === 0 ? '点击发送验证码' : count }}
  </button>
  <button @click="resume">继续</button>
  <button @click="pause">暂停</button>
  <RouterLink to="/">去首页</RouterLink>
  <div>--------------------------</div>
</template>
